package com.rpj.stauy.controller;

import com.rpj.stauy.service.MyAiService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class AiController {

    @Resource(name = "aiservice")
    private MyAiService myAiService;

    //http://localhost:9093/ai/chat
    @GetMapping("ai/chat")
    public String parametersChat(@RequestParam(value = "prompt",defaultValue = "1加1等于几") String prompt){
        return myAiService.chat(prompt);
    }
}
